#ifndef	HASH_H
#define	HASH_H

typedef struct hash_entry {
	const char			*s;
	void				*v;
	struct hash_entry	*next;
} HASH_ENTRY;

typedef struct hash_info {
	long			size;
	HASH_ENTRY		**list;
} HASH_INFO;

int hash_init(HASH_INFO *hi, long size);
void hash_finish(HASH_INFO *hi);
void *hash_lookup(HASH_INFO *hi, char *s);
void *hash_lookup_n(HASH_INFO *hi, char *s, long len);
int hash_insert(HASH_INFO* hi, char *s, void *v);

#endif
